﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_YH_QUSHUIKXXB实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_YH_QUSHUIKXXB
    {
        private decimal? m_dec_i_jlzt;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuorq;

        private DateTime? m_DT_d_tianjiarq;

        private string m_str_s_beizhu;

        private string m_str_s_caozuor;

        private string m_str_s_fengpianbh;

        private string m_str_s_huangxianbh;

        private string m_str_s_jieshuny;

        private string m_str_s_kaishiny;

        private string m_str_s_liuyubh;

        private string m_str_s_qushuidz;

        private string m_str_s_qushuifs;

        private string m_str_s_qushuikbh;

        private string m_str_s_qushuikm;

        private string m_str_s_qushuikph;

        private string m_str_s_qushuilx;

        private string m_str_s_qushuisy;

        private string m_str_s_shuiyuansz;

        private string m_str_s_shuiyuanszbz;

        private string m_str_s_shuiziybh;

        private string m_str_s_tianjiar;

        private string m_str_s_tuishuiwz;

        private string m_str_s_xingzhengqbh;

        private string m_str_s_xukezbh;

        private string m_str_s_zuobiao;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     行政区编号
        /// </summary>
        public string S_XINGZHENGQBH
        {
            get { return m_str_s_xingzhengqbh; }
            set { m_str_s_xingzhengqbh = value; }
        }

        /// <summary>
        ///     流域
        /// </summary>
        public string S_LIUYUBH
        {
            get { return m_str_s_liuyubh; }
            set { m_str_s_liuyubh = value; }
        }

        /// <summary>
        ///     水资源编号
        /// </summary>
        public string S_SHUIZIYBH
        {
            get { return m_str_s_shuiziybh; }
            set { m_str_s_shuiziybh = value; }
        }

        /// <summary>
        ///     分片编号
        /// </summary>
        public string S_FENGPIANBH
        {
            get { return m_str_s_fengpianbh; }
            set { m_str_s_fengpianbh = value; }
        }

        /// <summary>
        ///     环线标记
        /// </summary>
        public string S_HUANGXIANBH
        {
            get { return m_str_s_huangxianbh; }
            set { m_str_s_huangxianbh = value; }
        }

        /// <summary>
        ///     取水类型
        /// </summary>
        public string S_QUSHUILX
        {
            get { return m_str_s_qushuilx; }
            set { m_str_s_qushuilx = value; }
        }

        /// <summary>
        ///     取水方式
        /// </summary>
        public string S_QUSHUIFS
        {
            get { return m_str_s_qushuifs; }
            set { m_str_s_qushuifs = value; }
        }

        /// <summary>
        ///     取水口编号
        /// </summary>
        public string S_QUSHUIKBH
        {
            get { return m_str_s_qushuikbh; }
            set { m_str_s_qushuikbh = value; }
        }

        /// <summary>
        ///     许可证
        /// </summary>
        public string S_XUKEZBH
        {
            get { return m_str_s_xukezbh; }
            set { m_str_s_xukezbh = value; }
        }

        /// <summary>
        ///     取水地址
        /// </summary>
        public string S_QUSHUIDZ
        {
            get { return m_str_s_qushuidz; }
            set { m_str_s_qushuidz = value; }
        }

        /// <summary>
        ///     退水位置
        /// </summary>
        public string S_TUISHUIWZ
        {
            get { return m_str_s_tuishuiwz; }
            set { m_str_s_tuishuiwz = value; }
        }

        /// <summary>
        ///     取水水源
        /// </summary>
        public string S_QUSHUISY
        {
            get { return m_str_s_qushuisy; }
            set { m_str_s_qushuisy = value; }
        }

        /// <summary>
        ///     水源水质
        /// </summary>
        public string S_SHUIYUANSZ
        {
            get { return m_str_s_shuiyuansz; }
            set { m_str_s_shuiyuansz = value; }
        }

        /// <summary>
        ///     水源水质备注
        /// </summary>
        public string S_SHUIYUANSZBZ
        {
            get { return m_str_s_shuiyuanszbz; }
            set { m_str_s_shuiyuanszbz = value; }
        }

        /// <summary>
        ///     坐标
        /// </summary>
        public string S_ZUOBIAO
        {
            get { return m_str_s_zuobiao; }
            set { m_str_s_zuobiao = value; }
        }

        /// <summary>
        ///     备注
        /// </summary>
        public string S_BEIZHU
        {
            get { return m_str_s_beizhu; }
            set { m_str_s_beizhu = value; }
        }

        /// <summary>
        ///     记录状态
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     添加人
        /// </summary>
        public string S_TIANJIAR
        {
            get { return m_str_s_tianjiar; }
            set { m_str_s_tianjiar = value; }
        }

        /// <summary>
        ///     添加日期
        /// </summary>
        public DateTime? D_TIANJIARQ
        {
            get { return m_DT_d_tianjiarq; }
            set { m_DT_d_tianjiarq = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作日期
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }

        /// <summary>
        ///     开始年月
        /// </summary>
        public string S_KAISHINY
        {
            get { return m_str_s_kaishiny; }
            set { m_str_s_kaishiny = value; }
        }

        /// <summary>
        ///     结束年月
        /// </summary>
        public string S_JIESHUNY
        {
            get { return m_str_s_jieshuny; }
            set { m_str_s_jieshuny = value; }
        }

        /// <summary>
        ///     取水口名
        /// </summary>
        public string S_QUSHUIKM
        {
            get { return m_str_s_qushuikm; }
            set { m_str_s_qushuikm = value; }
        }

        /// <summary>
        ///     取水口牌号
        /// </summary>
        public string S_QUSHUIKPH
        {
            get { return m_str_s_qushuikph; }
            set { m_str_s_qushuikph = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_YH_QUSHUIKXXBProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_YH_QUSHUIKXXBProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB实体添加或者修改QS_YH_QUSHUIKXXB信息
        /// </summary>
        public bool InsertOrUpdate(QS_YH_QUSHUIKXXB QS_YH_QUSHUIKXXB, OracleTransaction Transaction)
        {
            if (QS_YH_QUSHUIKXXB.ID == 0)
                InsertQS_YH_QUSHUIKXXB(QS_YH_QUSHUIKXXB, Transaction);
            else
                UpdateQS_YH_QUSHUIKXXB(QS_YH_QUSHUIKXXB, Transaction);
            return QS_YH_QUSHUIKXXB.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB实体添加或修改QS_YH_QUSHUIKXXB信息
        /// </summary>
        public bool InsertOrUpdate(QS_YH_QUSHUIKXXB QS_YH_QUSHUIKXXB)
        {
            return InsertOrUpdate(QS_YH_QUSHUIKXXB, null);
        }


        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB主键删除QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YH_QUSHUIKXXB(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_YH_QUSHUIKXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB主键删除QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YH_QUSHUIKXXB(decimal ID)
        {
            return DeleteQS_YH_QUSHUIKXXB(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YH_QUSHUIKXXBsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_YH_QUSHUIKXXBsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YH_QUSHUIKXXBsDynamic(string WhereClause)
        {
            return DeleteQS_YH_QUSHUIKXXBsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB主键选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public QS_YH_QUSHUIKXXB SelectQS_YH_QUSHUIKXXB(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_QUSHUIKXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_YH_QUSHUIKXXB = PopulateQS_YH_QUSHUIKXXB(rd);
                rd.Close();
                return QS_YH_QUSHUIKXXB;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_YH_QUSHUIKXXB主键选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public QS_YH_QUSHUIKXXB SelectQS_YH_QUSHUIKXXB(decimal ID)
        {
            return SelectQS_YH_QUSHUIKXXB(ID, null);
        }

        /// <summary>
        ///     选择所有QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_QUSHUIKXXBsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <returns>所有QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsAll()
        {
            return SelectQS_YH_QUSHUIKXXBsAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_QUSHUIKXXBsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_YH_QUSHUIKXXBsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_QUSHUIKXXBsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_YH_QUSHUIKXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_YH_QUSHUIKXXB信息</returns>
        public DataTable SelectQS_YH_QUSHUIKXXBsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_YH_QUSHUIKXXBsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_YH_QUSHUIKXXB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YH_QUSHUIKXXBsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_YH_QUSHUIKXXBDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_YH_QUSHUIKXXB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YH_QUSHUIKXXBsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_YH_QUSHUIKXXBsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_YH_QUSHUIKXXB(QS_YH_QUSHUIKXXB QS_YH_QUSHUIKXXB, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_YH_QUSHUIKXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YH_QUSHUIKXXB.S_XINGZHENGQBH;
            storedParams[1].Value = QS_YH_QUSHUIKXXB.S_LIUYUBH;
            storedParams[2].Value = QS_YH_QUSHUIKXXB.S_SHUIZIYBH;
            storedParams[3].Value = QS_YH_QUSHUIKXXB.S_FENGPIANBH;
            storedParams[4].Value = QS_YH_QUSHUIKXXB.S_HUANGXIANBH;
            storedParams[5].Value = QS_YH_QUSHUIKXXB.S_QUSHUILX;
            storedParams[6].Value = QS_YH_QUSHUIKXXB.S_QUSHUIFS;
            storedParams[7].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKBH;
            storedParams[8].Value = QS_YH_QUSHUIKXXB.S_XUKEZBH;
            storedParams[9].Value = QS_YH_QUSHUIKXXB.S_QUSHUIDZ;
            storedParams[10].Value = QS_YH_QUSHUIKXXB.S_TUISHUIWZ;
            storedParams[11].Value = QS_YH_QUSHUIKXXB.S_QUSHUISY;
            storedParams[12].Value = QS_YH_QUSHUIKXXB.S_SHUIYUANSZ;
            storedParams[13].Value = QS_YH_QUSHUIKXXB.S_SHUIYUANSZBZ;
            storedParams[14].Value = QS_YH_QUSHUIKXXB.S_ZUOBIAO;
            storedParams[15].Value = QS_YH_QUSHUIKXXB.S_BEIZHU;
            storedParams[16].Value = QS_YH_QUSHUIKXXB.I_JLZT;
            storedParams[17].Value = QS_YH_QUSHUIKXXB.S_TIANJIAR;
            storedParams[18].Value = QS_YH_QUSHUIKXXB.D_TIANJIARQ;
            storedParams[19].Value = QS_YH_QUSHUIKXXB.S_CAOZUOR;
            storedParams[20].Value = QS_YH_QUSHUIKXXB.D_CAOZUORQ;
            storedParams[21].Value = QS_YH_QUSHUIKXXB.S_KAISHINY;
            storedParams[22].Value = QS_YH_QUSHUIKXXB.S_JIESHUNY;
            storedParams[23].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKM;
            storedParams[24].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKPH;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_YH_QUSHUIKXXB.ID = Convert.ToInt32(storedParams[25].Value);
            return result;
        }

        private bool UpdateQS_YH_QUSHUIKXXB(QS_YH_QUSHUIKXXB QS_YH_QUSHUIKXXB, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_YH_QUSHUIKXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YH_QUSHUIKXXB.S_XINGZHENGQBH;
            storedParams[1].Value = QS_YH_QUSHUIKXXB.S_LIUYUBH;
            storedParams[2].Value = QS_YH_QUSHUIKXXB.S_SHUIZIYBH;
            storedParams[3].Value = QS_YH_QUSHUIKXXB.S_FENGPIANBH;
            storedParams[4].Value = QS_YH_QUSHUIKXXB.S_HUANGXIANBH;
            storedParams[5].Value = QS_YH_QUSHUIKXXB.S_QUSHUILX;
            storedParams[6].Value = QS_YH_QUSHUIKXXB.S_QUSHUIFS;
            storedParams[7].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKBH;
            storedParams[8].Value = QS_YH_QUSHUIKXXB.S_XUKEZBH;
            storedParams[9].Value = QS_YH_QUSHUIKXXB.S_QUSHUIDZ;
            storedParams[10].Value = QS_YH_QUSHUIKXXB.S_TUISHUIWZ;
            storedParams[11].Value = QS_YH_QUSHUIKXXB.S_QUSHUISY;
            storedParams[12].Value = QS_YH_QUSHUIKXXB.S_SHUIYUANSZ;
            storedParams[13].Value = QS_YH_QUSHUIKXXB.S_SHUIYUANSZBZ;
            storedParams[14].Value = QS_YH_QUSHUIKXXB.S_ZUOBIAO;
            storedParams[15].Value = QS_YH_QUSHUIKXXB.S_BEIZHU;
            storedParams[16].Value = QS_YH_QUSHUIKXXB.I_JLZT;
            storedParams[17].Value = QS_YH_QUSHUIKXXB.S_TIANJIAR;
            storedParams[18].Value = QS_YH_QUSHUIKXXB.D_TIANJIARQ;
            storedParams[19].Value = QS_YH_QUSHUIKXXB.S_CAOZUOR;
            storedParams[20].Value = QS_YH_QUSHUIKXXB.D_CAOZUORQ;
            storedParams[21].Value = QS_YH_QUSHUIKXXB.S_KAISHINY;
            storedParams[22].Value = QS_YH_QUSHUIKXXB.S_JIESHUNY;
            storedParams[23].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKM;
            storedParams[24].Value = QS_YH_QUSHUIKXXB.S_QUSHUIKPH;
            storedParams[25].Value = QS_YH_QUSHUIKXXB.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_YH_QUSHUIKXXB PopulateQS_YH_QUSHUIKXXB(IDataReader dr)
        {
            var QS_YH_QUSHUIKXXB = new QS_YH_QUSHUIKXXB();
            QS_YH_QUSHUIKXXB.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_YH_QUSHUIKXXB.S_XINGZHENGQBH =
                dr["S_XINGZHENGQBH"] == DBNull.Value ? null : (string) dr["S_XINGZHENGQBH"];
            QS_YH_QUSHUIKXXB.S_LIUYUBH = dr["S_LIUYUBH"] == DBNull.Value ? null : (string) dr["S_LIUYUBH"];
            QS_YH_QUSHUIKXXB.S_SHUIZIYBH = dr["S_SHUIZIYBH"] == DBNull.Value ? null : (string) dr["S_SHUIZIYBH"];
            QS_YH_QUSHUIKXXB.S_FENGPIANBH = dr["S_FENGPIANBH"] == DBNull.Value ? null : (string) dr["S_FENGPIANBH"];
            QS_YH_QUSHUIKXXB.S_HUANGXIANBH = dr["S_HUANGXIANBH"] == DBNull.Value ? null : (string) dr["S_HUANGXIANBH"];
            QS_YH_QUSHUIKXXB.S_QUSHUILX = dr["S_QUSHUILX"] == DBNull.Value ? null : (string) dr["S_QUSHUILX"];
            QS_YH_QUSHUIKXXB.S_QUSHUIFS = dr["S_QUSHUIFS"] == DBNull.Value ? null : (string) dr["S_QUSHUIFS"];
            QS_YH_QUSHUIKXXB.S_QUSHUIKBH = dr["S_QUSHUIKBH"] == DBNull.Value ? null : (string) dr["S_QUSHUIKBH"];
            QS_YH_QUSHUIKXXB.S_XUKEZBH = dr["S_XUKEZBH"] == DBNull.Value ? null : (string) dr["S_XUKEZBH"];
            QS_YH_QUSHUIKXXB.S_QUSHUIDZ = dr["S_QUSHUIDZ"] == DBNull.Value ? null : (string) dr["S_QUSHUIDZ"];
            QS_YH_QUSHUIKXXB.S_TUISHUIWZ = dr["S_TUISHUIWZ"] == DBNull.Value ? null : (string) dr["S_TUISHUIWZ"];
            QS_YH_QUSHUIKXXB.S_QUSHUISY = dr["S_QUSHUISY"] == DBNull.Value ? null : (string) dr["S_QUSHUISY"];
            QS_YH_QUSHUIKXXB.S_SHUIYUANSZ = dr["S_SHUIYUANSZ"] == DBNull.Value ? null : (string) dr["S_SHUIYUANSZ"];
            QS_YH_QUSHUIKXXB.S_SHUIYUANSZBZ =
                dr["S_SHUIYUANSZBZ"] == DBNull.Value ? null : (string) dr["S_SHUIYUANSZBZ"];
            QS_YH_QUSHUIKXXB.S_ZUOBIAO = dr["S_ZUOBIAO"] == DBNull.Value ? null : (string) dr["S_ZUOBIAO"];
            QS_YH_QUSHUIKXXB.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string) dr["S_BEIZHU"];
            QS_YH_QUSHUIKXXB.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_YH_QUSHUIKXXB.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string) dr["S_TIANJIAR"];
            QS_YH_QUSHUIKXXB.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?) dr["D_TIANJIARQ"];
            QS_YH_QUSHUIKXXB.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_YH_QUSHUIKXXB.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            QS_YH_QUSHUIKXXB.S_KAISHINY = dr["S_KAISHINY"] == DBNull.Value ? null : (string) dr["S_KAISHINY"];
            QS_YH_QUSHUIKXXB.S_JIESHUNY = dr["S_JIESHUNY"] == DBNull.Value ? null : (string) dr["S_JIESHUNY"];
            QS_YH_QUSHUIKXXB.S_QUSHUIKM = dr["S_QUSHUIKM"] == DBNull.Value ? null : (string) dr["S_QUSHUIKM"];
            QS_YH_QUSHUIKXXB.S_QUSHUIKPH = dr["S_QUSHUIKPH"] == DBNull.Value ? null : (string) dr["S_QUSHUIKPH"];
            return QS_YH_QUSHUIKXXB;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion